import { Component, OnInit } from '@angular/core';
import { Quill } from 'quill';

@Component({
  selector: 'app-editor',
  templateUrl: './editor.component.html',
  styleUrls: ['./editor.component.scss']
})
export class EditorComponent implements OnInit {

  config = {
    toolbar: [
      ['bold', 'italic', 'underline', 'strike'], // toggled buttons
      ['blockquote', 'code-block'],
      [{ 'header': 1 }, { 'header': 2 }], // custom button values
      [{ 'list': 'ordered' }, { 'list': 'bullet' }],
      [{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript
      [{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
      [{ 'direction': 'rtl' }], // text direction
      [{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
      [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
      [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
      [{ 'font': [] }],
      [{ 'align': [] }],
      ['clean'], // remove formatting button
      ['link', 'image', 'video'],
      ['emoji'] // 引入表情
    ]
  }
  editor: any;
  constructor() { }

  ngOnInit(): void {
    // this.editor = new Quill('#container', {
    //   debug: 'info',
    //   modules: {
    //     toolbar: '#toolbar'
    //   },
    //   placeholder: 'Compose an epic...',
    //   readOnly: true,
    //   theme: 'snow'
    // })
  }

}
